package com.hhj.demo.jianzu;

import com.hhj.demo.dongwu.Monkey;
import com.hhj.demo.dongwu.Tiger;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import java.util.List;

/**
 * Created by KING on 2018/7/17.
 */
@Setter
@Getter
public class Zoom extends House implements HouseService, ApplicationContextAware {

    @Autowired
    private Tiger tiger;

    @Autowired
    private Monkey monkey;

    private String name = "Zoom";

    private static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("create Zoom bean! ");
        this.applicationContext = applicationContext;
    }

    public static Object getBean(String name) throws BeansException {
        return applicationContext.getBean(name);
    }

    @Override
    public List<House> getAll() {
        return null;
    }

    @Override
    public House findById() {
        return null;
    }

}
